package com.xuecheng.media.feignclient.content;

import com.xuecheng.content.model.dto.QueryTeachplanMediaDto;
import com.xuecheng.content.model.po.TeachplanMedia;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

@FeignClient(value="content-api",path="/content",contextId="teachplanMedia",
fallbackFactory=TeachplanMediaClientFactory.class)
@RequestMapping("/teachplanMedia")
public interface TeachplanMediaClient {
    /*
    * 注意：在Feign的远程调用的过程中，feign的get请求是不支持传递请求体参数的，如果请求
    * 参数中有@RequestBody注解，那么会强制将get请求转换为post请求，从而与服务端冲突，
    * 所以如果要传递@RequestBody请求体参数，最好使用post请求
    * */
    @PostMapping
    TeachplanMedia getTeachplanMedia(@RequestBody QueryTeachplanMediaDto dto);
}
